#方法包装-多进程实现
from multiprocessing import Process
import os
from time import sleep

def func1(name):
    print('当前进程ID：',os.getpid())
    print('父进程ID：',os.getppid())
    print(f'Process:{name}start')
    sleep(3)
    print(f'Process:{name}end')

if __name__=="__main__":
    print('当前进程ID:',os.getpid())
    #创建进程
    p1 = Process(target=func1,args=("p1",))
    p2 = Process(target=func1,args=('p2',))
    p1.start()
    p2.start()